<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div>
  <h1 matDialogTitle>Search Users</h1>
  <mat-dialog-content>
    <h5>Information</h5>
    <mat-divider></mat-divider>
    <small>
      When searching for users, you can create queries using SCIM 2.0 query syntax to refine your search (advanced search option).
      The search query must contain at least one valid expression with an attribute name followed by an attribute operator and an optional value.
      Multiple expressions may be combined using the logical operators ("and" / "or"). Operators "[", "]" and "not" are not supported.
    </small>

    <h5>Operators</h5>
    <mat-divider></mat-divider>
    <small>The following operators are supported :</small>
    <pre>
      <![CDATA[
       +----------+-------------+------------------------------------------+
       | Operator | Description | Behavior                                 |
       +----------+-------------+------------------------------------------+
       | eq       | equal       | The attribute and operator values must   |
       |          |             | be identical for a match.                |
       |          |             |                                          |
       | ne       | not equal   | The attribute and operator values are    |
       |          |             | not identical.                           |
       |          |             |                                          |
       | co       | contains    | The entire operator value must be a      |
       |          |             | substring of the attribute value for a   |
       |          |             | match.                                   |
       |          |             |                                          |
       | sw       | starts with | The entire operator value must be a      |
       |          |             | substring of the attribute value,        |
       |          |             | starting at the beginning of the         |
       |          |             | attribute value.  This criterion is      |
       |          |             | satisfied if the two strings are         |
       |          |             | identical.                               |
       |          |             |                                          |
       | ew       | ends with   | The entire operator value must be a      |
       |          |             | substring of the attribute value,        |
       |          |             | matching at the end of the attribute     |
       |          |             | value.  This criterion is satisfied if   |
       |          |             | the two strings are identical.           |
       |          |             |                                          |
       | pr       | present     | If the attribute has a non-empty or      |
       |          | (has value) | non-null value, or if it contains a      |
       |          |             | non-empty node for complex attributes,   |
       |          |             | there is a match.                        |
       |          |             |                                          |
       | gt       | greater     | If the attribute value is greater than   |
       |          | than        | the operator value, there is a match.    |
       |          |             | The actual comparison is dependent on    |
       |          |             | the attribute type.  For string          |
       |          |             | attribute types, this is a               |
       |          |             | lexicographical comparison, and for      |
       |          |             | DateTime types, it is a chronological    |
       |          |             | comparison.                              |
       |          |             |                                          |
       | ge       | greater     | If the attribute value is greater than   |
       |          | than or     | or equal to the operator value, there is |
       |          | equal to    | a match.  The actual comparison is       |
       |          |             | dependent on the attribute type.  For    |
       |          |             | string attribute types, this is a        |
       |          |             | lexicographical comparison, and for      |
       |          |             | DateTime types, it is a chronological    |
       |          |             | comparison.                              |
       |          |             |                                          |
       | lt       | less than   | If the attribute value is less than the  |
       |          |             | operator value, there is a match.  The   |
       |          |             | actual comparison is dependent on the    |
       |          |             | attribute type.  For string attribute    |
       |          |             | types, this is a lexicographical         |
       |          |             | comparison, and for DateTime types, it   |
       |          |             | is a chronological comparison.           |
       |          |             |                                          |
       | le       | less than   | If the attribute value is less than or   |
       |          | or equal to | equal to the operator value, there is a  |
       |          |             | match.  The actual comparison is         |
       |          |             | dependent on the attribute type.  For    |
       |          |             | string attribute types, this is a        |
       |          |             | lexicographical comparison, and for      |
       |          |             | DateTime types, it is a chronological    |
       |          |             | comparison.                              |
       +----------+-------------+------------------------------------------+
      ]]>
    </pre>

    <h5>Examples</h5>
    <mat-divider></mat-divider>
    <small>The following examples will help you to start with this feature. All the attribute names are based on the User model provided by the Rest API.</small>
    <pre>
      <![CDATA[
      List disabled users
      -> enabled eq false

      List users updated after 06/01/2019 but before 01/01/2020
      -> updatedAt gt "2019-06-01T00:00:00.000Z" and updatedAt lt "2020-01-01T00:00:00.000Z"

      List users by first name
      -> firstName co "john"
      ]]>
    </pre>
  </mat-dialog-content>
  <mat-dialog-actions>
    <span fxFlex></span>
    <button type="button" mat-raised-button (click)="dialogRef.close()" class="dialog-cancel">Close</button>
  </mat-dialog-actions>
</div>
